package com.mobile.collect.beans;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.ToMany;

import java.util.List;

import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.DaoException;

import com.google.gson.annotations.Expose;
import com.mobile.collect.db.DaoSession;
import com.mobile.collect.db.DevicePointInfoDao;
import com.mobile.collect.db.DevicePicInfoDao;




@Entity
public class DevicePicInfo {

    @Id
    private Long _ID;
    private Long parentId;

    private String unitName;
    private String deviceName;
    private String distance;
    private String reference;
    private String label;
    private String direction;
    private String floor;
    private String status;
    private String picPath;
    private String picNo;
    private int picBitMapWidth;
    private int picBitmapHeight;
    private long pointCount;
    private boolean lableIsRepeat;
    private boolean isCopy;
    private long createTime;
    private int sortIndex;


    @Expose
    @ToMany(referencedJoinProperty = "parentId")
    private List<DevicePointInfo> pointList;
    /**
     * Used to resolve relations
     */
    @Generated(hash = 2040040024)
    private transient DaoSession daoSession;
    /**
     * Used for active entity operations.
     */
    @Generated(hash = 43845274)
    private transient DevicePicInfoDao myDao;

    @Generated(hash = 1152762139)
    public DevicePicInfo(Long _ID, Long parentId, String unitName, String deviceName, String distance,
            String reference, String label, String direction, String floor, String status,
            String picPath, String picNo, int picBitMapWidth, int picBitmapHeight, long pointCount,
            boolean lableIsRepeat, boolean isCopy, long createTime, int sortIndex) {
        this._ID = _ID;
        this.parentId = parentId;
        this.unitName = unitName;
        this.deviceName = deviceName;
        this.distance = distance;
        this.reference = reference;
        this.label = label;
        this.direction = direction;
        this.floor = floor;
        this.status = status;
        this.picPath = picPath;
        this.picNo = picNo;
        this.picBitMapWidth = picBitMapWidth;
        this.picBitmapHeight = picBitmapHeight;
        this.pointCount = pointCount;
        this.lableIsRepeat = lableIsRepeat;
        this.isCopy = isCopy;
        this.createTime = createTime;
        this.sortIndex = sortIndex;
    }

    @Generated(hash = 104840430)
    public DevicePicInfo() {
    }

    public String getUnitName() {
        return unitName;
    }

    public void setUnitName(String unitName) {
        this.unitName = unitName;
    }

    public String getReference() {
        return reference;
    }

    public void setReference(String reference) {
        this.reference = reference;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getDirection() {
        return direction;
    }

    public void setDirection(String direction) {
        this.direction = direction;
    }

    public String getFloor() {
        return floor;
    }

    public void setFloor(String floor) {
        this.floor = floor;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Long get_ID() {
        return _ID;
    }

    public void set_ID(Long _ID) {
        this._ID = _ID;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public String getPicPath() {
        return picPath;
    }

    public void setPicPath(String picPath) {
        this.picPath = picPath;
    }

    /**
     * To-many relationship, resolved on first access (and after reset).
     * Changes to to-many relations are not persisted, make changes to the target entity.
     */
    @Generated(hash = 504805404)
    public List<DevicePointInfo> getPointList() {
        if (pointList == null) {
            final DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            DevicePointInfoDao targetDao = daoSession.getDevicePointInfoDao();
            List<DevicePointInfo> pointListNew = targetDao
                    ._queryDevicePicInfo_PointList(_ID);
            synchronized (this) {
                if (pointList == null) {
                    pointList = pointListNew;
                }
            }
        }
        return pointList;
    }

    /**
     * Resets a to-many relationship, making the next get call to query for a fresh result.
     */
    @Generated(hash = 18518400)
    public synchronized void resetPointList() {
        pointList = null;
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 128553479)
    public void delete() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.delete(this);
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 1942392019)
    public void refresh() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.refresh(this);
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 713229351)
    public void update() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.update(this);
    }

    public int getPicBitMapWidth() {
        return this.picBitMapWidth;
    }

    public void setPicBitMapWidth(int picBitMapWidth) {
        this.picBitMapWidth = picBitMapWidth;
    }

    public int getPicBitmapHeight() {
        return this.picBitmapHeight;
    }

    public void setPicBitmapHeight(int picBitmapHeight) {
        this.picBitmapHeight = picBitmapHeight;
    }

    public String getDeviceName() {
        return deviceName;
    }

    public void setDeviceName(String deviceName) {
        this.deviceName = deviceName;
    }

    public String getDistance() {
        return distance;
    }

    public void setDistance(String distance) {
        this.distance = distance;
    }

    public String getPicNo() {
        return picNo;
    }

    public void setPicNo(String picNoTv) {
        this.picNo = picNoTv;
    }

    public boolean getLableIsRepeat() {
        return this.lableIsRepeat;
    }

    public void setLableIsRepeat(boolean lableIsRepeat) {
        this.lableIsRepeat = lableIsRepeat;
    }

    public boolean isCopy() {
        return isCopy;
    }

    public void setCopy(boolean copy) {
        isCopy = copy;
    }

    public boolean getIsCopy() {
        return this.isCopy;
    }

    public void setIsCopy(boolean isCopy) {
        this.isCopy = isCopy;
    }

    public long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(long createTime) {
        this.createTime = createTime;
    }

    public long getPointCount() {
        return pointCount;
    }

    public void setPointCount(long pointCount) {
        this.pointCount = pointCount;
    }

    @Override
    public String toString() {
        return "DevicePicInfo{" +
                "_ID=" + _ID +
                ", parentId=" + parentId +
                ", unitName='" + unitName + '\'' +
                ", deviceName='" + deviceName + '\'' +
                ", distance='" + distance + '\'' +
                ", reference='" + reference + '\'' +
                ", label='" + label + '\'' +
                ", direction='" + direction + '\'' +
                ", floor='" + floor + '\'' +
                ", status='" + status + '\'' +
                ", picPath='" + picPath + '\'' +
                ", picNo='" + picNo + '\'' +
                ", picBitMapWidth=" + picBitMapWidth +
                ", picBitmapHeight=" + picBitmapHeight +
                ", pointCount=" + pointCount +
                ", lableIsRepeat=" + lableIsRepeat +
                ", isCopy=" + isCopy +
                ", createTime=" + createTime +
                ", sortIndex=" + sortIndex +
                '}';
    }

    public int getSortIndex() {
        return this.sortIndex;
    }

    public void setSortIndex(int sortIndex) {
        this.sortIndex = sortIndex;
    }

    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 1096143166)
    public void __setDaoSession(DaoSession daoSession) {
        this.daoSession = daoSession;
        myDao = daoSession != null ? daoSession.getDevicePicInfoDao() : null;
    }
}
